MAPS
Photo by L’Odyssee Belle on Unsplash
Migration has been politicized before it has been analyzed…
— Paul Collier
ne_world <- ne_countries(scale = "small", returnclass = "sf")
# include only countries included in data
ne_world <- filter(ne_world, iso_a3 %in% unique(df_flows$ISO))
# theme parameters
theme_opts <- theme(
legend.position = "bottom",
legend.title = element_blank(),
axis.text = element_blank(),
axis.line = element_blank(),
axis.ticks = element_blank(),
axis.title = element_blank(),
panel.grid = element_blank(),
panel.grid.major = element_blank(),
panel.grid.minor = element_blank(),
panel.background=element_blank(),
panel.border = element_blank(),
plot.background = element_blank()
)
# color palette to use
cluster_pal <- wes_palette("Zissou1", 4, type = "continuous")
v1 <- ggplot(data = ne_world) +
geom_sf(fill="#f5f5f5", color="#d5d5d5", stroke=0.5) +
geom_segment( data = df_flows, aes( x = LONFR, y = LATFR, xend = LONTO, yend = LATTO, color = BIN, alpha = BIN, group = ISO ), size=0.5 ) +
# geom_curve( data = df_flows, aes( x = LONFR, y = LATFR, xend = LONTO, yend = LATTO, color = BIN, alpha = BIN, group = ISO ), size=0.5, curvature=0.2) +
scale_color_manual(values = cluster_pal, guide = FALSE) +
scale_alpha_manual(values = c(0.6, 0.4, 0.3, 0.2), guide = FALSE) +
theme_bw() +
labs(x="",
y="",
title = "Latin America and the Caribbean 1km Internal Migration Flows",
subtitle="Estimated internal human migration flows between\nsubnational administrative units for malaria endemic countries",
caption="World Pop; WHO, 2015; http://www.who.int/malaria/publications/country-profiles/en/") +
theme_opts
girafe(ggobj = v1, width_svg = 720/72, height_svg = 1080/72,
options = list(opts_sizing(rescale = FALSE, width = 1.0))
)